import Vue from "vue";
import { v4 as uuidv4 } from "uuid";
import VectorCom from "./view/view-index.vue";
export default class VectorInstance {
  constructor(options) {
    this.map = options.map;
    const comVue = Vue.extend(VectorCom);
    this.component = new comVue();
    this.componentMap = new Map();
  }
  show() {
    const element = document.createElement("div");
    this.component.$mount(element);
    document.getElementById("map").appendChild(this.component.$el);
    const id = uuidv4();
    this.componentMap.set(id, this.component);
    const initOptions = {
      map: this.map,
    };
    this.component.init(initOptions);
  }
}